<template>
  <div class="trace-container">
    <div class="trace-header">
      <h2>溯源管理</h2>
    </div>
    <div class="trace-content">
      <el-menu
        :default-active="$route.path"
        class="trace-menu"
        router>
        <el-menu-item index="/trace">
          <i class="el-icon-document"></i>
          <span>批次管理</span>
        </el-menu-item>
        <el-menu-item index="/trace/warehouse">
          <i class="el-icon-office-building"></i>
          <span>仓库质检</span>
        </el-menu-item>
        <el-menu-item index="/trace/logistics">
          <i class="el-icon-truck"></i>
          <span>物流管理</span>
        </el-menu-item>
      </el-menu>
      <div class="trace-main">
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'TraceIndex',
  data() {
    return {
      activeMenu: '/trace'
    }
  }
}
</script>

<style scoped>
.trace-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.trace-header {
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
}

.trace-header h2 {
  margin: 0;
  color: #303133;
}

.trace-content {
  flex: 1;
  display: flex;
  margin-top: 20px;
  background-color: #fff;
  padding: 20px;
}

.trace-menu {
  width: 200px;
  border-right: 1px solid #e6e6e6;
}

.trace-main {
  flex: 1;
  padding: 20px;
}
</style> 